#ifndef LINEAR_H_INC
#define LINEAR_H_INC

typedef struct S_Linear {
	double m_k, m_b;
	void Reset(double k, double b) {
		m_k = k;
		m_b = b;
	}
	void Connect(double x1, double y1, double x2, double y2) {
		m_k = (y2 - y1) / (x2 - x1);
		m_b = y1 - m_k * x1;
	}
	double y(double x) {
		return(m_k * x + m_b);
	}
} Linear;

#endif
